import Vue from 'vue'
import Router from 'vue-router'
// 这里导入可以让让用户访问的组件
import Home from "../components/Home";
import Login from "../components/common/Login";
import Register from "../components/common/Register";
import Course from "../components/Course";
import Detail from "@/components/Detail"
import Aliplayer from "@/components/Aliplayer"
import Cart from "@/components/Cart"
import Order from "@/components/Order"
Vue.use(Router);

export default new Router({
  // 设置路由模式为‘history’，去掉默认的#
  mode: 'history',
  routes: [
    // 路由列表
    {
      name: 'Home',
      path: '/',
      component: Home,
    },
    {
      name: 'Home',
      path: '/home',
      component: Home
    },
    {
      name: 'Login',
      path: '/login',
      component: Login
    },
    {
      name: 'Register',
      path: '/register',
      component: Register
    },
        {
      name: 'Course',
      path: '/course',
      component: Course
    },{
      path: '/course/:course',  // 路由的命名参数，:变量名
      name: "Detail",
      component: Detail
    },{
      path: '/aliplayer',  // 路由的命名参数，:变量名
      name: "Aliplayer",
      component: Aliplayer
    },
    {
      path: '/cart',  // 路由的命名参数，:变量名
      name: "Cart",
      component: Cart
    },
       {
      path: '/buy',
      name: "Order",
      component: Order
    }
  ]
})
